<template>
	<view>
		<uni-section title="奖品图片" sub-title="" type="line">
			<uni-swiper-dot :info="images" :current="current" field="content" mode="default">
				<swiper>
					<swiper-item v-for="item, index of images" :key="index">
						<image :src="item.content" mode=""></image>
					</swiper-item>
				</swiper>
			</uni-swiper-dot>
		</uni-section>
		<uni-section title="奖品信息" sub-title="" type="line">
			<uni-list>
				<uni-list-item title="奖品名称" :right-text="prize.prizeName"></uni-list-item>
				<uni-list-item title="奖品介绍" :right-text="prize.introduction"></uni-list-item>
				<uni-list-item title="状态" :right-text="getEnumLabel(PRIZE_STATUS_KEY, prize.status)"></uni-list-item>
			</uni-list>
		</uni-section>
	</view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getEnumLabel, PRIZE_STATUS_KEY } from '../../utils/enum.js'

let id = '0'

const images = ref([])
const current = ref(0)

const prize = ref({
	prizeName: '奖品1',
	introduction: '好奖品',
	status: 0,
	prizeImg: 'http://dummyimage.com/200x100;http://dummyimage.com/201x100'
})

images.value = prize.value.prizeImg.split(';').map((item) => ({
	content: item
}))

onLoad((query) => {
	console.log(query.id)
	id = query.id
})
</script>

<style>

</style>
